<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;


class CreateDealLogTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('deal_log', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('user_id')->comment('交易人');
            $table->integer('to_user_id')->default(0)->comment('交易给谁');
            $table->decimal('money','8','2')->default(0)->comment('交易金额');
            $table->tinyInteger('status')->default(0)->comment('1增加2减少');
            $table->string('comment')->default('')->comment('详情');
            $table->timestamps();
        });
        DB::statement("ALTER TABLE `deal_log` comment '交易记录表';");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('deal_log');
    }
}
